package com.yunxin.core.infra.persistence.mapper.user;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunxin.core.application.dto.merchant.MerchantUserAccountInfoDTO;
import com.yunxin.core.domain.model.order.OrderUserWeightResult;
import com.yunxin.core.domain.model.team.Team;
import com.yunxin.core.domain.model.team.UserTeamShip;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserTeamShipMapper extends BaseMapper<UserTeamShip> {
    List<OrderUserWeightResult> getUserWeightByTeamId(@Param("teamId") Long teamId);

    /**
     * 团队管理员，根据userId查询团队信息
     * @param userId
     * @return
     */
    List<Team> getTeamListByUserId(@Param("userId") Long userId);

    /**
     * 团队管理员只能看自己团队下的子账户
     * @param userId
     * @return
     */
    List<MerchantUserAccountInfoDTO> getUserForTeamList(@Param("userId") Long userId);

    /**
     * 团队管理员只能看自己团队下的子账户
     * @param teamIds
     * @return
     */
    List<MerchantUserAccountInfoDTO> getUserForTeamListByTeamIds(@Param("teamIds") List<Long> teamIds);
    //只查询角色为boke的用户
    List<UserTeamShip> selectUserTeamShipByTeamIds(@Param("teamIds") List<Long> teamIds);
}
